#ifndef CONVERSIONS_H
#define CONVERSIONS_H

#include <string>
#include <sstream>

namespace Conversions
{    
    // Convert a T to a string.
    template<typename T>
    std::string toString(const T& t)
    {
        std::ostringstream oss;
        oss << std::dec << t;
        return oss.str();
    }

    // Conver a string to a T.
    template<typename T>
    T fromString(const std::string& s)
    {
        T t;
        std::istringstream iss(s);
        iss >> std::dec >> t;
        return t;
    }
}

#endif